<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class Menu extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'menu';

    /**
     *搜索
     */
    public static function getMenu($where=[])
    {
       return  self::select('id','menu_name')->when($where,function ($query,$where){
            return $query->where($where['field'],$where['value']);
       })->get();
    }

}
